Skip to content

Conversation

@brianschubert
Copy link
Member

mypy.checkexpr.HasTypeVarQuery has only one usage and is virtually1 identical to mypy.types.HasTypeVars. Merging them seems sensible. The latter has wider usage via has_type_vars, so it seems like the better one to keep.

Some history for the record:

  • mypy.checkexpr.HasTypeVarQuery was added in 12 years ago a40efb4
  • mypy.types.HasTypeVars was added 5 years ago in 59617e8

Footnotes

  1. the only difference is that HasTypeVars sets self.skip_alias_target = True, but this seem to fit the usage of HasTypeVarQuery just as well.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninja
Copy link
Collaborator

🧹

@hauntsaninja hauntsaninja merged commit 267a35d into python:master Dec 1, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants